home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frmMain
- Caption = "Program Manager Example"
- ClientHeight = 3300
- ClientLeft = 60
- ClientTop = 630
- ClientWidth = 4110
- LinkTopic = "Form1"
- MaxButton = 0 'False
- ScaleHeight = 3300
- ScaleWidth = 4110
- StartUpPosition = 2 'CenterScreen
- Begin VB.CommandButton Command4
- Caption = "Load Program"
- Height = 375
- Left = 600
- TabIndex = 4
- Top = 2520
- Width = 1335
- End
- Begin VB.CommandButton Command3
- Caption = "Remove File"
- BeginProperty Font
- Name = "Arial"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 2160
- TabIndex = 3
- Top = 2520
- Width = 1335
- End
- Begin VB.TextBox Text1
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- BeginProperty Font
- Name = "Arial"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 285
- Left = 600
- Locked = -1 'True
- TabIndex = 2
- Top = 2040
- Width = 3375
- End
- Begin VB.ListBox List1
- BeginProperty Font
- Name = "Arial"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 1530
- Left = 120
- TabIndex = 0
- ToolTipText = "Double-Click to load program"
- Top = 360
- Width = 3855
- End
- Begin VB.Label Label3
- Caption = "Visit my homepage: www.fpsoftware.bizland.com"
- BeginProperty Font
- Name = "Arial"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 240
- TabIndex = 6
- Top = 3000
- Width = 3735
- End
- Begin VB.Line Line2
- BorderColor = &H8000000C&
- X1 = 0
- X2 = 4080
- Y1 = 0
- Y2 = 0
- End
- Begin VB.Line Line1
- BorderColor = &H80000009&
- BorderWidth = 4
- X1 = 0
- X2 = 4080
- Y1 = 0
- Y2 = 0
- End
- Begin VB.Label Label2
- Caption = "Programs:"
- BeginProperty Font
- Name = "Arial"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 120
- TabIndex = 5
- Top = 120
- Width = 735
- End
- Begin VB.Label Label1
- Caption = "Path:"
- BeginProperty Font
- Name = "Arial"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 120
- TabIndex = 1
- Top = 2040
- Width = 375
- End
- Begin VB.Menu mnuFile
- Caption = "File"
- Begin VB.Menu mnuAdd
- Caption = "&Add File..."
- End
- Begin VB.Menu mnuRemove
- Caption = "&Remove File"
- End
- Begin VB.Menu hl1
- Caption = "-"
- End
- Begin VB.Menu mnuExit
- Caption = "&Exit"
- End
- End
- Attribute VB_Name = "frmMain"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub Command3_Click()
- If List1 = "" Then: Exit Sub ' this is here to prevent a bug
- iniPath$ = App.Path & "\progmansav.ini"
- 'Erases from Program Save file
- entry$ = ""
- r% = WritePrivateProfileString("Program" & frmMain.List1.ListIndex, "Description", entry$, iniPath$)
- List1.RemoveItem List1.ListIndex
- Text1.Text = ""
- End Sub
- Private Sub Command4_Click()
- Dim pid As Long
- If List1 = "" Then: Exit Sub
- Call Shell(Text1.Text, vbNormalFocus)
- End Sub
- Private Sub Form_Load()
- Dim strItem As String
- Dim strDir As String
- On Error Resume Next
- strDir = App.Path & "\progmansav2.ini" ' directory path
- Open strDir For Input As #1 '<-loading list
- While Not EOF(1)
- Input #1, strItem
- DoEvents
- List1.AddItem strItem 'replace ListBox With your listbox
- Wend
- Close #1
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- mnuExit_Click
- End Sub
- Private Sub List1_Click()
- iniPath$ = App.Path & "\progmansav.ini"
- Text1.Text = GetFromINI("Program" & List1.ListIndex + 1, "Path", iniPath$)
- End Sub
- Private Sub List1_DblClick()
- Dim pid As Long
- If List1 = "" Then: Exit Sub
- Call Shell(Text1.Text, vbNormalFocus)
- End Sub
- Private Sub mnuAdd_Click()
- Load frmAddFile
- frmAddFile.Show
- End Sub
- Private Sub mnuExit_Click()
- Dim strDir As String
- Dim lngSave As Long
- On Error Resume Next
- strDir = App.Path & "\progmansav2.ini"
- Open strDir For Output As #1 '<- saving list
- For lngSave& = 0 To List1.ListCount - 1
- Print #1, List1.List(lngSave&) 'replace ListBox With your listbox
- Next lngSave&
- Close #1
- Unload Me
- End Sub
- Private Sub mnuRemove_Click()
- If List1 = "" Then: Exit Sub ' this is here to prevent a bug
- iniPath$ = App.Path & "\progmansav.ini"
- 'Erases from Program Save file
- entry$ = ""
- r% = WritePrivateProfileString("Program" & frmMain.List1.ListIndex, "Description", entry$, iniPath$)
- List1.RemoveItem List1.ListIndex
- Text1.Text = ""
- End Sub
-